snapshot: Preallocate and don't memset the state stack
authorAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 14:03:06 +0000 (16:03 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 29 Sep 2020 14:03:06 +0000 (16:03 +0200)
commit796e6ee3062dc7d2eae5cb9a48f66a4e84b2992a
treeeb1066e60cbbed1c96fd310fce4953295f36774f
parent18b8b499de22907ad1177953fb8ef734c721b586
snapshot: Preallocate and don't memset the state stack

Most of the time the snapshot is less than 16 levels deep (did some testing
in gtk-demo), so lets pre-allocate 16 levels of state stack to avoid the
extra allocation most of the time.
gtk/gtksnapshot.c